package com.junzhiit.nengji.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum ApplyRefundIdentity {
	
	BUYER(0,"买家"),
	SHOP(1,"商家"),
	PLATFORM(2,"平台");
	
	private Integer value;
	private String text;

	private ApplyRefundIdentity(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public Integer toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static ApplyRefundIdentity toStatus(Integer value) {
		if (BUYER.value == value) {
			return BUYER;
		} else if (SHOP.value == value) {
			return SHOP;
		}else {
			throw new InvalidArgumentException("Unknown value[" + value + "].");
		}
	}
}
